package top.laoliu.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.laoliu.mapper.PositionMapper;
import top.laoliu.pojo.Position;
import top.laoliu.pojo.PositionVo;
import top.laoliu.service.PositionService;

import java.util.List;

/**
 * @Author: acer
 * @Date: 2020/10/13 16:58
 * @Description:
 */
@Service
public class PositionServiceImpl implements PositionService {
    @Autowired
    PositionMapper positionMapper;

    @Override
    public List<PositionVo> getLimitedPositions(Integer index, Integer size) {
        return positionMapper.getLimitedPositions(index,size);
    }

    @Override
    public List<PositionVo> getLimitedPositionsByBrowsing(Integer index, Integer size) {
        return positionMapper.getLimitedPositionsByBrowsing(index,size);
    }

    @Override
    public PositionVo getPositionById(Integer position_id) {
        return positionMapper.getPositionById(position_id);
    }

    @Override
    public List<PositionVo> getLimitedOtherPositions(String industry, Integer position_id, Integer index, Integer size) {
        return positionMapper.getLimitedOtherPositions(industry,position_id,index,size);
    }

    @Override
    public List<PositionVo> getPositionsBySearchTime(String position, String workplace,String classification, Integer currentPage, Integer pageSize) {
        return positionMapper.getPositionsBySearchTime(position,workplace,classification,(currentPage-1)*pageSize,pageSize);
    }

    @Override
    public List<PositionVo> getPositionsBySearchBrowsing(String position, String workplace, Integer currentPage, Integer pageSize) {
        return positionMapper.getPositionsBySearchBrowsing(position,workplace,currentPage,pageSize);
    }

    @Override
    public Integer getPositionTotalCountBySearch(String position, String workplace,String classification) {
        return positionMapper.getPositionTotalCountBySearch(position,workplace,classification);
    }

    @Override
    public int updatePosition(PositionVo position) {
        return positionMapper.updatePosition(position);
    }

    @Override
    public List<String> getLimitedPositionName() {
        return positionMapper.getLimitedPositionName();
    }

    @Override
    public List<PositionVo> getPositionByClassification(String classification) {
        return positionMapper.getPositionByClassification(classification);
    }

    @Override
    public List<Position> getPositionsByCompany_id(Integer company_id) {
        return positionMapper.getPositionsByCompany_id(company_id);
    }

    @Override
    public int insertPosition(Position position) {
        return positionMapper.insertPosition(position);
    }
}
